/*
 * UIGlobals.java
 *
 * store all UI Global variables
 *
 */

package net.kernub.client;

import net.kernub.client.core.UpdateCaller;

public class UIGlobals extends UpdateCaller
{
	private static UIGlobals gInstance = null;

	private boolean labelManagable = false;
	private boolean linkAddable = false;
	private boolean linkEditable = false;
	private boolean linkRemovable = false;
	private boolean homeEditable = false;

	private UIGlobals()
	{
	}

	public static void createInstance()
	{
		if( gInstance == null )
			gInstance = new UIGlobals();
	}

	public static UIGlobals instance()
	{
		return gInstance;
	}

	public void set( final boolean labelManagable,
									 final boolean linkAddable,
									 final boolean linkEditable,
									 final boolean linkRemovable,
									 final boolean homeEditable )
	{
		this.labelManagable = labelManagable;
		this.linkAddable = linkAddable;
		this.linkEditable = linkEditable;
		this.linkRemovable = linkRemovable;
		this.homeEditable = homeEditable;

		callUpdateHandlers();
	}

	public void reset()
	{
		this.labelManagable = false;
		this.linkAddable = false;
		this.linkEditable = false;
		this.linkRemovable = false;
		this.homeEditable = false;

		callUpdateHandlers();
	}

	public boolean getLabelManagable()
	{
		return this.labelManagable;
	}

	public boolean getLinkAddable()
	{
		return this.linkAddable;
	}

	public boolean getLinkEditable()
	{
		return this.linkEditable;
	}

	public boolean getLinkRemovable()
	{
		return this.linkRemovable;
	}

	public boolean getHomeEditable()
	{
		return this.homeEditable;
	}
};

